<?php
  include ('dbsettings.php');
  $query = "SELECT * FROM document, user WHERE document.owner = user.id";
  if ($result = $mysqli->query($query)) {
  
    // Lese alle Dokumente
    // ---
    $stack = array ();
    while ($row = $result->fetch_object()) {
      array_push ($stack, $row);
    }
    $result->close();
  }
  $mysqli->close();
  echo json_encode($stack); 
?>
